<?php echo $header;echo $sidebar ?>		

		<style>
			a.edit_icon {
		    background: url("<?php echo $this->config->base_url(); ?>assets/admin/admin_images/icons/edit.gif") no-repeat scroll left top transparent;
		    display: inline-block;
		    height: 16px;
		    width: 16px;
			}
			a.delete2_icon {
   	 			background: url("<?php echo $this->config->base_url(); ?>assets/admin/images/icon/delete.png") no-repeat scroll left top transparent;
    			display: inline-block;
    			height: 16px;
    			width: 16px;
			}
			ul.yiiPager {
			    border: 0 none;
			    display: inline;
			    font-size: 11px;
			    line-height: 100%;
			    margin: 0;
			    padding: 0;
			}
			
			ul.yiiPager a:link, ul.yiiPager a:visited {
			    border: 1px solid #9AAFE5;
			    color: #0E509E;
			    font-weight: bold;
			    padding: 1px 6px;
			    text-decoration: none;
			}
		</style>
		<div class="span10 content">

			<?php echo $hugemenu ?>

			<h1>Email Marketing</h1>

			<?php if($this->session->flashdata('message')) {?>
			<div class="alert alert-success">
				<?php echo $this->session->flashdata('message') ?>
			</div>
			<br />
			<?php  }?>
			

			<div>
			
				<!-- Nav tabs -->
				<ul class="nav nav-tabs">
				  <li><a href="/index.php/email_marketing/template">Templates</a></li>
				  <li><a href="/index.php/email_marketing/settings">Settings</a></li>
				  <li><a href="/index.php/email_marketing/mass_campaigns">Mass Campaigns</a></li>
				  <li><a href="/index.php/email_marketing/sent_mail">Sent Mail</a></li>
				  <li><a href="/index.php/email_marketing/hot_leads">Hot Leads</a></li>
				  <li><a href="/index.php/email_marketing/alerts">Alerts</a></li>
				  <li><a href="/index.php/email_marketing/subscription">Subscriptions</a></li>
				  <li><a href="/index.php/email_marketing/mailing_list">Mailing List</a></li>
				  <li><a href="/index.php/email_marketing/filters">Filters</a></li>
				  <li class="active"><a href="#">Group</a></li>
				</ul>
				
				<!-- Tab panes -->
				<div class="tab-content">
				<h4>Contact Group</h4>
				<?php 
					if(isset($group_id)) { $ad = $group_id; }else{ $ad ='';}
					echo form_open('emailgroup/add?groupd_id='.$ad); 
				?>	
					<input type="hidden" name="edit_group_id" value="<?php echo (isset($edit_result['group_id'])) ? $edit_result['group_id']:'' ?>" />
				  <table border="0" cellpadding="5" cellspacing="5" width="50%"> 
					<tr>
						<td>Group Name</td>
						<td><input type="text" name="group_name" id="group_name" value="<?php echo set_value('group_name',isset($edit_result['group_name']) ? $edit_result['group_name']:'');?>" />
						<?php if(form_error('group_name')) { ?><span class="errormsg_image"><?php echo form_error('group_name');?></span><?php } ?>
						</td>
						<td>Status</td>
						<td>
							<?php $options = array('1'=>"Active", '0'=>"Inactive");					
							echo form_dropdown('status',$options,set_value('status',isset($edit_result['status'])?$edit_result['status']:''),'class="styled"');?>
						</td>
					</tr>
					
					<?php if(isset($group_id)) { ?>
					<input type="hidden" name="group_id" id="group_id" value="<?php echo $edit_result['group_id']; ?>" />	  
					<?php } ?>
					</table>
					
					<table class="table table-striped table-bordered table-hover table-primary">

					<thead>
						<tr>
							<th></th>
							<th>User Login</th>
							<th>Name</th>
							<th>Company</th>
							<th>Email</th>
							<th>Phone</th>
						</tr>

					</thead>

					<tbody>
							<?php foreach($getall_users->result() as $userinfo):?>
							<?php $checked = (in_array($userinfo->id, $arrGroupUser))?'checked="checked"':''; ?>
							<?php $bgcolor = (in_array($userinfo->id, $arrGroupUser))?'style="background-color:#CCFFFF;"':''; ?>
							<tr>
								<td <?php echo $bgcolor; ?>><input type="checkbox" name="group_emaillist[]" value="<?php echo $userinfo->id;?>" class="ids" <?php echo $checked; ?> /></td>
								<td <?php echo $bgcolor; ?>><?php echo $userinfo->username; ?></td>
								<td <?php echo $bgcolor; ?>><?php echo $userinfo->first_name." ".$userinfo->last_name; ?></td>
								<td <?php echo $bgcolor; ?>><?php echo $userinfo->company; ?></td>
								<td <?php echo $bgcolor; ?>><?php echo $userinfo->email; ?></td>
								<td <?php echo $bgcolor; ?>><?php echo $userinfo->phone; ?></td>
							</tr>
							<?php endforeach; ?>
							<tr>
							<td colspan="6"><input type="submit" name="save" id="save" value="save"  class="btn btn-primary" />&nbsp;&nbsp;&nbsp;&nbsp;
							<input type="button" name="cancel" id="cancel" value="cancel"  class="btn btn-primary" />
							</td>
					</tr>
					</tbody>
				</table>
				
				<?php echo form_close();?>
				
				</div>
				
			</div>
		</div><!--/content-->
<?php echo $footer ?> 